package example2;

import org.apache.commons.io.FileUtils;
import org.junit.Test;

import java.net.URI;

public class URLTest {


    @Test
    public void t3() throws Exception {

        FileUtils.copyURLToFile(URI.create("https:" + "//unpkg.byted-static.com/xgplayer/2.31.2/browser/index.js").toURL(),
                FileUtils.getFile("D:/IWork/WEB/demo/js", "xgplayer/2.31.2/browser/index.js"));

        FileUtils.copyURLToFile(URI.create("https:" + "//unpkg.byted-static.com/xgplayer-mp4/2.0.0/browser/index.js").toURL(),
                FileUtils.getFile("D:/IWork/WEB/demo/js", "xgplayer-mp4/2.0.0/browser/index.js"));

        FileUtils.copyURLToFile(URI.create("https:" + "//unpkg.byted-static.com/xgplayer/2.31.6/browser/index.js").toURL(),
                FileUtils.getFile("D:/IWork/WEB/demo/js", "xgplayer/2.31.6/browser/index.js"));

        FileUtils.copyURLToFile(URI.create("https:" + "//sf1-cdn-tos.huoshanstatic.com/obj/media-fe/xgplayer_doc_video/mp4/xgplayer-demo-720p.mp4").toURL(),
                FileUtils.getFile("D:/IWork/WEB/demo", "media-fe/xgplayer_doc_video/mp4/xgplayer-demo-720p.mp4"));

        FileUtils.copyURLToFile(URI.create("https:" + "//lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/byted-player-videos/1.0.0/poster.jpg").toURL(),
                FileUtils.getFile("D:/IWork/WEB/demo", "expire-1-M/byted-player-videos/1.0.0/poster.jpg"));

        FileUtils.copyURLToFile(URI.create("https:" + "//sf1-cdn-tos.huoshanstatic.com/obj/media-fe/xgplayer_doc_video/mp4/xgplayer-demo-480p.mp4").toURL(),
                FileUtils.getFile("D:/IWork/WEB/demo", "media-fe/xgplayer_doc_video/mp4/xgplayer-demo-480p.mp4"));

        FileUtils.copyURLToFile(URI.create("https:" + "//sf1-cdn-tos.huoshanstatic.com/obj/media-fe/xgplayer_doc_video/mp4/xgplayer-demo-360p.mp4").toURL(),
                FileUtils.getFile("D:/IWork/WEB/demo", "media-fe/xgplayer_doc_video/mp4/xgplayer-demo-360p.mp4"));


    }

}
